home *** CD-ROM | disk | FTP | other *** search
- program Requester;
-
- uses Exec,AmigaDOS,Intuition;
-
- const
- ReqTitle : string[30] = 'Requester test'#0;
- ReqBody : string[60] = 'In how many years do you think'#10'Bill G. will be bankrupt?'#0;
- ReqGadgets : string[40] = '1|2|3|4|5|6'#0;
-
- var
- es : tEasyStruct;
-
- procedure Cleanup(mes: string);
- var
- rc : long;
- begin
- rc:=RETURN_OK;
- if mes<>'' then
- begin
- Writeln('AsyncRequester :',mes);
- rc:=RETURN_WARN;
- end;
-
- if IntuitionBase<>NIL then CloseLibrary(pLibrary(IntuitionBase));
- halt(rc);
- end;
-
- procedure OpenLibs;
- begin
- IntuitionBase:=pIntuitionBase(OpenLibrary('intuition.library',36));
- if IntuitionBase=NIL then Cleanup('Can''t open intuition.library V36!');
- end;
-
- procedure DoRequester;
- var
- res : long;
- begin
- es.es_StructSize:=sizeof(tEasyStruct);
- es.es_Flags:=0;
- es.es_Title:=@ReqTitle[1];
- es.es_TextFormat:=@ReqBody[1];
- es.es_GadgetFormat:=@ReqGadgets[1];
-
- res:=EasyRequestArgs(IntuitionBase^.ActiveWindow,@es,NIL,NIL);
-
- Write('You clicked on ');
-
- case res of
- 0: Writeln('6');
- else Writeln(res);
- end;
- end;
-
- begin
- OpenLibs;
- DoRequester;
- Cleanup('');
- end.